




 
 
/* The Shadow of Social Desirability Bias  */
/* Ding Li, Xiaobo Lu, Shuang Ma, Wenhui Yang */
/* 	May 7, 2025    */
/* STATA 18 */








 clear
graph drop _all
set matsize 5000
set more off




 
 
 *** Please set the data folder as the  the working directory

 
 global path "F:\Dropbox\Research\PSRM\replication file"


  cd "$path\data"
 
 log using mainresult.log, text replace


 
  **********************************************************
****Main results
**********************************************************
 
 
 
 
 
 
**********************************************************
****Figure 1
**********************************************************


*******************************
**Data analysis
*******************************


****The code for results for CHFS(list experiment) is included in the R script file titled "Figure 1".





 

use "CFPS_2014.dta",clear

 **2014
ci means trust_cadre_dummy


use "CFPS_2016.dta",clear

 **2016
ci means trust_cadre_dummy



*******************************
**Figure Plot
*******************************
clear

import excel "mean.xlsx", sheet("all") firstrow

set scheme s1mono

gen percent=100*round(proportion,.0001)
tostring percent, gen(text) force
gen text1=substr(text, 1, 5)
 
gen p="%"
egen txt_percent = concat(text1 p) 

twoway ///
(rcap low95 high95 row, vert ) /// 
(scatter proportion row if group ==1, mcolor(gs8)  lcolor(gs8) lpattern(solid) mlabel(txt_percent ) msize(vsmall) mlabposition(10)) /// 
(scatter proportion row if group ==2, mcolor(gs8)  lcolor(gs8)  lpattern(dash) mlabel(txt_percent ) msize(vsmall) mlabposition(10)) /// 
(scatter proportion row if group ==3, mcolor(black) lcolor(black)  lpattern(solid) mlabel(txt_percent ) msize(vsmall) mlabposition(10)) /// 
, leg(off) /// 
xlabel(2 "CHFS(List Exp.)" 3 "CFPS(Listwise, 2014)" 4 "CFPS(Listwise, 2016)" , angle(0) noticks labsize(vsmall)) ///
ylabel(0 "0%" 0.1 "10%" 0.2 "20%"  0.3 "30%"  0.40 "40%" 0.5 "50%", angle(0)) /// 
xtitle("Local Political Trust",height(5)) ///
ytitle("Estimated Proportion") 

 graph export "$path\fig_1.pdf", as(pdf) replace






**********************************************************
****Figure 2
**********************************************************


****Notes:
****The figure plots the estimated coefficients in Table A5, for original data analysis, please check the code for Table A5




clear

import excel "results.xlsx", sheet("insurance") firstrow

tostring coef, gen(text) force

 set scheme s1mono

twoway ///
(rcap low95 high95 row, vert ) /// 
(scatter coef row if group ==1, mcolor(gs8)  msymbol(o)mlabel(text) mlabposition(11)) /// 
(scatter coef row if group ==2, mcolor(gs8) msymbol(d)   mlabel(text ) mlabposition(8)) /// 
(scatter coef row if group ==3, mcolor(black) msymbol(s)  mlabel(text ) mlabposition(8)) /// 
, legend(row(1) order(2 "CHFS(list)" 3 "CFPS 2014" 4 "CFPS 2016" ) pos(6)) /// 
xlabel(3 "Health Insurance" 7 "Pension Insurance" 11 "New Rural Pension Scheme"  , angle(0) noticks labsize(small)) ///
ylabel(-0.8(0.2)0.6) yline(0) ///
xtitle("Social Insurance",height(5)) ///
ytitle("The Effects of Social Insurance on Trust in Local Officials", height(5) size(small)) title("",height(5) size(normarlsize)) ///
graphregion(fcolor(white)) ylab(,nogrid) 



graph export "$path\fig_2.pdf", as(pdf) replace







  *************************************************************
**** Figure 3
************************************************************** 
 
 use "boot_list_direct",clear
 
 
 
 ttest  direct_coef_health==list_coef_health
 
 ttest  direct_coef_pension==list_coef_pension

 ttest  direct_coef_nrpp==list_coef_nrpp 
 
 



clear



import excel "results.xlsx", sheet("diff1") firstrow


twoway ///
(rcap low95 high95 row, vert lcolor(black)) /// 
(scatter coef row if group == 1, lcolor(black) mcolor(black) msize(small) lpattern(solid)) /// 
(scatter coef row if group == 2, lcolor(black) mcolor(black) msize(small) lpattern(solid)) /// 
(scatter coef row if group == 3, lcolor(black) mcolor(black) msize(small) lpattern(solid)) /// 
, leg(off) /// 
xlabel(2 "Health Insurance" 3 "Pension Insurance" 4 "NRPS", angle(0) labsize(small)) /// 
ytitle("Direct-List Difference", height(5) size(small)) /// 
title("", size(small) color(black)) /// 
ylabel(0(0.5)2) xtitle("", height(5)) /// 
graphregion(fcolor(white)) ylab(, nogrid)

graph export "$path\fig_3.pdf", as(pdf) replace









**********************************************************
****Figure 4
**********************************************************

*******************************
**Data analysis
*******************************


**list 
***The code for the list experiment results is included in the R script entitled "Figure 4"


*** OLS
 use "CFPS_2014",clear

 reg trust_cadre_dummy NRPP logfincome  age male school_yr hukou ccp  log_pop_10_13  log_gdp_pc_10_13 pro_rural  if rural==1

**individual FE


  use "CFPS_panel.dta",clear
 
xtreg trust_cadre_dummy  NRPP logfincome  age  male school_yr hukou ccp log_pop  log_gdp_pc pro_rural i.year if rural==1,fe

 ***DID
 use "CFPS_10_12.dta",clear

reghdfe support_gov_dummy treat   logfincome  age  male school_yr  ccp  pro_rural logpop logpgdp if rural==1 & age>=60, ab(countyID year) cluster(cntygb)


***IV
 use "CFPS_2014",clear

 
 ivreg2   trust_cadre_dummy (NRPP=agedummy ) logfincome  age male school_yr hukou ccp  log_pop_10_13  log_gdp_pc_10_13 pro_rural  if rural==1

 
**fuzzy RD,*bandwidth==6


ivreg2   trust_cadre_dummy (NRPP=agedummy agediff)  agediff male school_yr hukou ccp  log_pop_10_13  log_gdp_pc_10_13 pro_rural  if age<=66&age>=54 &rural==1


 
**matching

 psmatch2 NRPP logfincome  age  male school_yr hukou ccp log_pop_10_13  log_gdp_pc_10_13 pro_rural  if rural==1, out(trust_cadre_dummy) neighbor(3) caliper(0.01) 

 
 
*******************************
**Figure Plot
*******************************



clear

import excel "results.xlsx", sheet("NRPP") firstrow

set scheme s1mono

gen coef=round(coefficient,.001)
tostring coef, gen(text) force
gen text1=substr(text, 1, 5)
replace text1="0.043" if group==1
replace text1="0.008" if group==2
replace text1="-0.003" if group==3
replace text1="0.017" if group==4
replace text1="0.041" if group==5
replace text1="-0.003" if group==6
replace text1="0.053" if group==7



twoway ///
(rcap low95 high95 row, vert ) /// 
(scatter coefficient row if group ==1,  color(gs8) lpattern(solid)  mlabel(text1) mlabposition(11))  /// 
(scatter  coefficient row if group ==2, color(gs8) lpattern(solid)  mlabel(text1) mlabposition(11)) /// 
(scatter  coefficient row if group ==3, color(gs8) lpattern(solid)  mlabel(text1) mlabposition(11)) ///
(scatter  coefficient row if group ==4,  color(gs8) lpattern(solid)  mlabel(text1) mlabposition(11)) ///  
(scatter  coefficient row if group ==5,  color(gs8) lpattern(solid)  mlabel(text1) mlabposition(11)) /// 
(scatter  coefficient row if group ==6,  color(gs8) lpattern(solid)  mlabel(text1) mlabposition(11)) /// 
(scatter  coefficient row if group ==7,  color(gs8) lpattern(solid)  mlabel(text1) mlabposition(11)) /// 
, leg(off) /// 
xlabel(2 "OLS" 3 "List" 4 "Individual FE" 5 "DID" 6 "IV" 7 "Fuzzy RD" 8 "Matching", angle(0) noticks labsize(small)) ///
xtitle("Identification Strategies",height(5)) ylabel(-0.6[0.2]0.6)  ///
ytitle("Estimated Coefficient of NRPS",height(5))  yline(0, lpattern(dash) lcolor(red))

graph export "$path\fig_4.pdf", as(pdf) replace





log close
